package mollmapsgenerator;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author hanis
 */
public class SignatureMappingHandler {

    private List<Land> lands;

    private Map<String, String> areaMapping;
    private Map<String, Land> landMapping;

    SignatureMappingHandler() {
        areaMapping = new HashMap<String, String>();
        landMapping = new HashMap<String, Land>();
        lands = new ArrayList<Land>();
    }




    public String getAreaName(String signature) {
        return areaMapping.get(signature);
    }

    public Land getLand(String signature) {
        return landMapping.get(signature);
    }

    public void addArea(String signature, String area) {
        areaMapping.put(signature, area);

    }

    public void addLand(Land land) {
        lands.add(land);
        for (String signature : land.getSignatures()) {
            landMapping.put(signature, land);
        }
    }



    public void writeAll() {
        for (String sig : areaMapping.keySet()) {
            System.out.println(sig + " - " + areaMapping.get(sig));
        }

        for (Land land : lands) {
            System.out.println("--------------------------------------------");
            System.out.println(land);
        }

    }


}
